package idiet.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Validate {
	private final static String emailRegex="^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
	public static boolean emailValidate(String sample){
		if(sample==null)
			return false;
		
		Pattern regex = Pattern.compile(emailRegex);  
		Matcher matcher = regex.matcher(sample);  
		return  matcher.matches(); 
	}
}
